package com.jf.net

import androidx.lifecycle.LifecycleOwner
import kotlinx.coroutines.CoroutineScope

/**
 * INetworkManager
 * @author hao.yin
 * @time 2023/8/21 10:19
 * @description 网络管理
 */
interface INetworkManager {

    /**
     * 设置retrofit拦截器，可用于自定义请求字段封装
     * @param interceptor 拦截器
     * @return INetworkManager
     * */
    fun setInterceptorForCreator(interceptor: IServiceInterceptor): INetworkManager

    /**
     * 设置生命周期owner用于请求生命周期关联
     * @param lifecycleOwner 发送的数据请求体
     * @return INetworkManager
     * */
    fun setLifeCycleOwner(lifecycleOwner: LifecycleOwner): INetworkManager

    /**
     * 设置CoroutineScope用于协程使用
     * @param coroutineScope 协程CoroutineScope
     * @return INetworkManager
     * */
    fun setCoroutineScope(coroutineScope: CoroutineScope): INetworkManager

    /**
     * 网络信息ready响应
     * @return INetworkManager
     * */
    fun onNetInfoReady(): INetworkManager

    /**
     * 执行销毁操作
     */
    fun onDestroy()


}